﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DeployGames.TweenEngine.TestBed.acessors;

namespace DeployGames.TweenEngine.TestBed
{
    public partial class Form1 : Form
    {
        TweenManager tweenManager;
        public Form1()
        {
            InitializeComponent();
            tweenManager = new TweenManager();

            Tween.registerAccessor(typeof(AcessorTextBox), new TextboxAcessor());
        }

        public void Update(double delta, double time)
        {
            tweenManager.update((float)delta);
        }

        private void button_Click(object sender, EventArgs e)
        {
            Button bt = sender as Button;
            string tag = bt.Tag.ToString();
            txtTarget.Location = new Point(3, 18);
            Tween.to(txtTarget, TextboxAcessor.X, 1.5f)
                .ease(TweenEquations.getEase(tag))
                .targetRelative(428f)
                .start(tweenManager);
        }
    }
}
